// ports.c
unsigned char inb(unsigned int port)
{
   unsigned char ret;
   asm volatile ("inb %%dx,%%al":"=a" (ret):"d" (port));
   return ret;
}
void outb(unsigned int port, unsigned char value)
{
   asm volatile ("outb %%al,%%dx": :"d" (port), "a" (value));
}
/*unsigned short inw(unsigned int port)
{
   unsigned short ret;
   asm volatile ("inw %%dx,%%al":"=a" (ret):"d" (port));
   return ret;
}
void outw(unsigned int port, unsigned short value)
{
   asm volatile ("outw %%al,%%dx": :"d" (port), "a" (value));
}
unsigned ind(unsigned int port)
{
   unsigned ret;
   asm volatile ("ind %%dx,%%al":"=a" (ret):"d" (port));
   return ret;
}
void outd(unsigned int port, unsigned value)
{
   asm volatile ("outd %%al,%%dx": :"d" (port), "a" (value));
}*/